package visitor;

import frame.Frame;
import syntaxtree.*;

public class IRVisitor implements Visitor {

	private Frame curFrame;
	private Program program;

	public IRVisitor(Program p, Frame initialFrame) {
		this.curFrame = initialFrame;
		this.program = p;
	}

	public void visit(Program n) {
		n.m.accept(this);
		for (int i = 0; i < n.cl.size(); i++) {
			n.cl.elementAt(i).accept(this);
		}
	}

	public void visit(MainClass n) {
		/*Frame newFrame = curFrame.newFrame("main", 1);
		Frame oldFrame = curFrame;
		curFrame = newFrame;

		tree.Stm s = n.s.accept(this).unNx();

		tree.IExp retExp = new tree.CONST(0);
		tree.Stm body = new tree.MOVE(new tree.TEMP(curFrame.RV()),
				new tree.ESEQ(s, retExp));
		*/
	}

	public void visit(ClassDeclSimple n){};

	public void visit(ClassDeclExtends n){};

	public void visit(VarDecl n){};

	public void visit(MethodDecl n){};

	public void visit(Formal n){};

	public void visit(IntArrayType n){};

	public void visit(BooleanType n){};

	public void visit(IntegerType n){};

	public void visit(IdentifierType n){};

	public void visit(Block n){};

	public void visit(If n){};

	public void visit(While n){};

	public void visit(Print n){};

	public void visit(Assign n){};

	public void visit(ArrayAssign n){};

	public void visit(And n){};

	public void visit(LessThan n){};

	public void visit(Plus n){};

	public void visit(Minus n){};

	public void visit(Times n){};

	public void visit(ArrayLookup n){};

	public void visit(ArrayLength n){};

	public void visit(Call n){};

	public void visit(IntegerLiteral n){};

	public void visit(True n){};

	public void visit(False n){};

	public void visit(IdentifierExp n){};

	public void visit(This n){};

	public void visit(NewArray n){};

	public void visit(NewObject n){};

	public void visit(Not n){};

	public void visit(Identifier n){}

	public void visit(NullType n) {}

	public void visit(StringArrayType n) {};
}
